import request from '../utils/request';

/**
 * 上传临时文件接口
 * @param {FormData} file 文件
 */
export function uploadFileApi(file) {
  return request({
    url: '/upload/file',
    method: 'post',
    data: file
  });
}

/**
 * 上传设备参数excel文件接口
 * @param {any} file excel文件(.xls,.xlsx)
 */
export function uploadDeviceParameterApi(file) {
  console.log(file);
  return request({
    url: '/upload/parameters',
    method: 'post',
    data: file
  });
}

/**
 *  上传设备excel文件接口
 * @param {any} file excel文件(.xls, .xlsx)
 */ 
export function uploadDeviceApi(file) {
  console.log(file);
  return request({
    url: '/upload/devices',
    method: 'post',
    data: file
  });
}

/**
 * 上传用户信息excel文件接口
 * @param {any} file excel文件(.xls, .xlsx)
 */
export function uploadUserApi(file) {
  console.log(file);
  return request({
    url: '/upload/users',
    method: 'post',
    data: file
  });
}

/**
 *  批量导入升级包/设备设置下的设备模板
 * @param {any} file excel文件(.xls, .xlsx)
 */ 
export function uploadUpgradeDeviceApi(file) {
  console.log(file);
  return request({
    url: '/upload/products/import',
    method: 'post',
    data: file
  });
}

/**
 *  批量导入升级设备模板
 * @param {any} file excel文件(.xls, .xlsx)
 */ 
export function uploadOnlyUpgradeDeviceApi(file) {
  console.log(file);
  return request({
    url: '/upload/products',
    method: 'post',
    data: file
  });
}
